﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;
using Microsoft.Xna.Framework.Net;
using Microsoft.Xna.Framework.Storage;

namespace Ssb.ContentTypes
{
    public class Menu_Content
        : ContentType
    {
        public string Parent;
        public List<string> Items;
        public string cursor;
        public string bg;

        public Menu_Content()
        {
            
        }

        public Menu Build(Game game)
        {
            Initialize(game);

            List<MenuItem> lmi = new List<MenuItem>();

            foreach(string path in Items) // Load the menuitem_contents and build them into a list
            {
                MenuItem mi = cm.Load<MenuItem_Content>(path).Build(game);
                lmi.Add(mi);
            }

            Menu m;

            
            m = new Menu(game, null, lmi);
            m.bg = Game.Content.Load<Texture2D>(bg);
            

            foreach (MenuItem mi in m.Items)
            {
                mi.owner = m;
            }

            return m;
        }
    }
}
